# -*- coding: utf-8 -*-

# File Name : valid
# Description :
# Author : marje
# date : 2022/6/9
# Change Activity : 2022/6/9
CHINESE_CHAR = '京津冀晋蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼渝川贵云藏陕甘青宁新港澳'
CAR_ALPHABET = 'QWERTYUIOPASDFGHJKLZXCVBNM01'


def check_is_valid_external_truck_number(text):
    """

    Args:
        text:

    Returns:

    """
    if not isinstance(text, str):
        return False
    number_size = len(text)
    if number_size not in (7, 8):
        return False
    first_number = text[0]
    if first_number not in CHINESE_CHAR:
        return False
    second_number = text[1]
    if second_number not in CAR_ALPHABET:
        return False
    remaining_word = text[2:]
    for c in remaining_word:
        if c in CHINESE_CHAR:
            return False
    return True
